﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class Modules_News_Show : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        int newid = Convert.ToInt32(Request["NewsID"].ToString());
        MysqlHelp NewsShow = new MysqlHelp();
        DataTable NewsTable = new DataTable();
        NewsTable = NewsShow.GetDatabysql("SELECT * FROM news WHERE id='" + newid + "'");
        Label_Title.Text = NewsTable.Rows[0][1].ToString();
        Label_Time.Text =  NewsTable.Rows[0][3].ToString();
        Label_Text.Text = NewsTable.Rows[0][2].ToString();

        int publisher = Convert.ToInt32(NewsTable.Rows[0][4].ToString());
        NewsTable = NewsShow.GetDatabysql("SELECT * FROM admin WHERE id='" + publisher+ "'");
        Label_Publisher.Text = NewsTable.Rows[0][1].ToString();
    }
}
